import request from '@/utils/request'

/**
 * 加入购物车，同步服务端数据
 * @returns 
 */
export const addToCartApi = (userid: string, proid: string, num: number) => request({
  url: '/api/cart/add',
  method: 'POST',
  data: {
    userid,
    proid,
    num,
  }
})

/**
 * 查询用户在服务端的购物车数据
 * @param userid 
 * @returns 
 */
export const getServerCart = (userid: string) => request({
  url: '/api/cart/list',
  method: 'POST',
  data: {
    userid,
  },
})
